package org.easy.wechat;


import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author: Li chaojie
 * @Date: 2022/3/21
 * @Description:
 */
@Configuration
@EnableConfigurationProperties({DynamicWechatProperties.class})
@AutoConfigureAfter
@ConditionalOnProperty(prefix = DynamicWechatProperties.PREFIX, name = "enabled", havingValue = "true", matchIfMissing = false)
public class DynamicWechatAutoConfiguration {

    @Bean
    public ThirdWechatService thirdWechatService(DynamicWechatProperties dynamicWechatProperties) {
        return new ThirdWechatServiceImpl(dynamicWechatProperties);
    }

}
